package com.example.Controller;

import com.example.Service.QueryService;
import com.example.Service.VivoGPTService;
import com.example.utils.AudioConverter;
import com.example.utils.WavMin;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.MediaType;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;

import java.io.IOException;

/**
 * 补充是后续接口
 */
@RestController
@RequestMapping("/zhangfan")
public class VivoGPTController {

    @Autowired
    private VivoGPTService vivoGPTService;

    @Autowired
    private QueryService queryService;

    /**
     *
     *
     */
    @PostMapping("/liuhao")
    public String recognizer(@RequestParam("file") MultipartFile audioFile,String user) throws Exception {
        return vivoGPTService.testVivoGPT(audioFile,user);
    }

    @GetMapping("/wanghongmei")
    public String Query(String liuhao ,String zhangfan , String chentin) throws Exception {

        return queryService.QueryRewrite(liuhao,zhangfan,chentin);
    }
}
